package com.zyh.service;

import com.zyh.Repository.StudentRepository;
import com.zyh.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentService {
    @Autowired
    StudentRepository studentRepository;

    public Student findStudentBySno(int sno){
        Student student=studentRepository.findBySno(sno);
        return student;
    }

    public Student findStudentByName(String name){
        Student student=studentRepository.findByName(name);
        return student;
    }

    public Student save(Student student){
        return studentRepository.save(student);
    }


}
